<%@page import="com.office.automate.model.authenticate.UserAuthenticator"%>
<%@page import="com.office.automate.frontier.utility.Utility"%>
<%@page import="com.office.automate.configuration.property.ConfigurationProperties"%>
<%@page import="java.util.Properties"%>
<% 
	UserAuthenticator currentUserSession = (UserAuthenticator) (session.getAttribute("currentSessionUser"));
	if (currentUserSession == null) {
		return;
	}
	Properties configSeqProps = ConfigurationProperties.getProps(); 
	Utility util = new Utility(currentUserSession.getSecurityLevels());
%>
<tr>
	<td>
		<div id='cssmenu' align="center">
			<ul>
				<li><a href='/OfficeAutomation/jsp/HomePage.jsp'><span>Home</span></a></li>
				<% if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MAIN_EMPLOYEE_MANAGEMENT"))) { %>
				<li class='has-sub'><a href='#'><span>Employee Management</span></a>
					<ul>
					<% if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("REGISTER_NEW_EMPLOYEE"))) { %>
						<li><a href='/OfficeAutomation/jsp/employee/RegisterNewEmployee.jsp'><span>Employee Registration</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("ADD_EMPLOYEE_QUALIFICATION"))) { 
					%>
						<li><a href='/OfficeAutomation/jsp/employee/Qualifications.jsp'><span>Qualification</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("APPLY_FOR_OVERTIME"))) { 
					%>
						<li><a href='/OfficeAutomation/jsp/employee/ApplyForOverTime.jsp'><span>Apply For Overtime</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("APPROVE_OVERTIME"))) { 
					%>
						<li><a href='/OfficeAutomation/jsp/employee/ApproveOverTimeRequest.jsp'><span>Approve Overtime</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("EMPLOYEE_SEARCH"))) { 
					%>
						<li><a href='/OfficeAutomation/jsp/employee/Search.jsp'><span>Search</span></a></li>
					<%
						}
					%>
					</ul>
				</li>
				<% 
				} 
				if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MAIN_LEAVE_MANAGEMENT"))) { 
				%>
				<li><a href='#'><span>Leave Management</span></a>
					<ul>
					<% if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("DAILY_ATTENDANCE"))) { %>
						<li><a href='/OfficeAutomation/jsp/employee/EmployeeAttendance.jsp'><span>Daily Attendance</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("APPLY_LEAVE"))) { 
					%>					
						<li><a href='/OfficeAutomation/jsp/leave/ApplyForLeave.jsp'><span>Apply Leave</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("APPROVE_LEAVE"))) { 
					%>					
						<li><a href='/OfficeAutomation/jsp/leave/ApproveLeave.jsp'><span>Approve Leave</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("APPLY_FOR_LIEU_LEAVE"))) { 
					%>						
					    <li><a href='/OfficeAutomation/jsp/leave/RequestForLieuLeave.jsp'><span>Apply For Lieu Leave</span></a></li>
					<%
						}
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("APPROVE_LIEU_LEAVE"))) { 
					%>					   
					    <li><a href='/OfficeAutomation/jsp/leave/ApproveLieuLeave.jsp'><span>Approve Lieu Leave</span></a></li>
					<%
						}
					%>
					</ul>
				</li>
				<% 
				} 
				if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MAIN_REPORTING"))) { 
				%>
				<li><a href='#'><span>Reporting</span></a>
					<ul>
					<% if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("REPORT_LEAVE_DETAILS"))) { %>
						<li><a href='/OfficeAutomation/jsp/report/LeaveApplyDetailsSubmitReport.jsp'><span> Leave Details</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("REPORT_EMPLOYEE_DETAILS"))) { 
					%>			
						<li><a href='/OfficeAutomation/jsp/report/EmployeeDetailsReport.jsp'><span> Employee Details</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("REPORT_EMPLOYEE_SALARY_DETAILS"))) { 
					%>			
						<li><a href='/OfficeAutomation/jsp/report/EmployeeSalaryDetailsSubmitReport.jsp'><span> Employee Salary Details</span></a></li>						
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("REPORT_COIN_ANALYSIS"))) { 
					%>			
						<li><a href='/OfficeAutomation/jsp/report/CurrentMonthCoinAnalysisDetailsReport.jsp'><span> Coin Analysis</span></a></li>
					<% 
						} 
					%>
					</ul>
				</li>
				<% } 
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MAIN_ADMINISTRATION"))) { 
				%>
				<li><a href='#'><span>Administration</span></a>
					<ul>
					<% if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MANAGE_BRANCHES"))) { %>
						<li><a href='/OfficeAutomation/jsp/administration/ManageBranches.jsp'><span>Manage Branches</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MANAGE_DIVISIONS"))) { 
					%>								
						<li><a href='/OfficeAutomation/jsp/administration/ManageDivisions.jsp'><span>Manage Divisions</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MANAGE_SECURITY_LEVELS"))) { 
					%>							
						<li><a href='/OfficeAutomation/jsp/administration/ManageSecurityLevels.jsp'><span>Manage Security Levels</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("ADD_PUBLIC_HOLODAYS"))) { 
					%>							
						<li><a href='/OfficeAutomation/jsp/administration/AddPublicHolidays.jsp'><span>Add Public Holidays</span></a></li>
					<%
						}
					%>							
					</ul>
				</li>
				<% } 
					if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MAIN_ACCOUNT"))) { 
				%>				
				<li class='last'><a href='#'><span>Account</span></a>
					<ul>
					<% if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("MY_PROFILE"))) { %>
						<li><a href='/OfficeAutomation/MyProfileServlet'><span>My Profile</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("CHANGE_PASSWORD"))) { 
					%>		
						<li><a href='/OfficeAutomation/jsp/employee/ChangePassword.jsp'><span>Change Password</span></a></li>
					<%
						}
						if (util.isFunctionalSecurityAllow(configSeqProps.getProperty("UPLOAD_IMAGE"))) { 
					%>		
						<li><a href='/OfficeAutomation/jsp/employee/UploadImage.jsp'><span>Upload Image</span></a></li>
					<%
						}
					%>		
					</ul>
				</li>
				<% } %>
			</ul>
		</div>
	</td>
</tr>